﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPages/Default.Master" CodeBehind="Default.aspx.vb" Inherits="GuildCMS.News._Default" %>

<%--

TODO:
-----
Shorten the item body displayed for each item.
  or
Do we go with a page break like Wordpress?

 --%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:Repeater ID="Repeater1" DataSourceID="SqlDataSource1" runat="server">
        <ItemTemplate>
            <div>
                <asp:HyperLink ID="lnkCategory" NavigateUrl='<%# Eval("Item_Category", "~/News/Category.aspx?id={0}") %>' runat="server"><%# Eval("Category_Name")%></asp:HyperLink>
                <asp:Label ID="lblSpacer" runat="server" Text=": "></asp:Label>
                <asp:HyperLink ID="lnkHeadline" NavigateUrl='<%# Eval("Item_Id", "~/News/Item.aspx?id={0}") %>' Text='<%# Eval("Item_Headline")%>' runat="server"></asp:HyperLink>
            </div>
            <div>
                <asp:Label ID="lblPosted" runat="server" Text="Posted on"></asp:Label> 
                <%# Format(Eval("Item_Date"), "MMMM dd, yyyy") %> <asp:Label ID="lblAt" runat="server" Text="at"></asp:Label> <%# Format(Eval("Item_Date"), "h:mmtt")%>
                <asp:Label ID="lblby" runat="server" Text="by"></asp:Label> 
                <asp:HyperLink ID="lnkAuthor" NavigateUrl='<%# Eval("Item_Author", "~/Character.aspx?id={0}") %>' Text='<%# Eval("Character_Name")%>' runat="server"></asp:HyperLink>
            </div>
            <div>
                <%# Eval("Item_Body")%>
            </div>
            <div>
                <asp:HyperLink ID="hlReadMore" NavigateUrl='<%# Eval("Item_Id", "~/Item.aspx?id={0}") %>' Text="Read more"  runat="server"></asp:HyperLink>
            </div>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <div>
                <asp:HyperLink ID="lnkCategory" NavigateUrl='<%# Eval("Item_Category", "~/News/Category.aspx?id={0}") %>' runat="server"><%# Eval("Category_Name")%></asp:HyperLink>
                <asp:Label ID="lblSpacer" runat="server" Text=": "></asp:Label>
                <asp:HyperLink ID="lnkHeadline" NavigateUrl='<%# Eval("Item_Id", "~/News/Item.aspx?id={0}") %>' Text='<%# Eval("Item_Headline")%>' runat="server"></asp:HyperLink>
            </div>
            <div>
                <asp:Label ID="lblPosted" runat="server" Text="Posted on"></asp:Label> 
                <%# Format(Eval("Item_Date"), "MMMM dd, yyyy") %> <asp:Label ID="lblAt" runat="server" Text="at"></asp:Label> <%# Format(Eval("Item_Date"), "h:mmtt")%>
                <asp:Label ID="lblby" runat="server" Text="by"></asp:Label> 
                <asp:HyperLink ID="lnkAuthor" NavigateUrl='<%# Eval("Item_Author", "~/Character.aspx?id={0}") %>' Text='<%# Eval("Character_Name") %>' runat="server"></asp:HyperLink>
            </div>
            <div>
                <%# Eval("Item_Body")%>
            </div>
            <div>
                <asp:HyperLink ID="hlReadMore" NavigateUrl='<%# Eval("Item_Id", "~/Item.aspx?id={0}") %>' Text="Read more"  runat="server"></asp:HyperLink>
            </div>
        </AlternatingItemTemplate>
    </asp:Repeater>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:SqlConnectionString %>" 
        SelectCommand="sp_public_getNewsAll" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>

</asp:Content>
